package com.liuchen.boot.system;

import com.liuchen.common.util.InitSystemParamUtils;
import org.apache.log4j.Logger;
import org.springframework.boot.SpringApplication;
import org.springframework.context.ApplicationContext;

/**
 * 启动类父类
 */
public class BaseApplication {

    //环境
    public static String env = "dev";
    //日志
    public static Logger log = Logger.getLogger(BaseApplication.class);

    //主方法
    public static void main(Class c, String[] args) {
        //初始化系统参数
        InitSystemParamUtils.initParam(log);
        //启动主方法
        ApplicationContext ctx = SpringApplication.run(c, args);
        //打印出当前的系统信息
        String[] activeProfiles = ctx.getEnvironment().getActiveProfiles();
        for (String profile : activeProfiles) {
            log.info(">>>> Spring Boot 使用profile为: " + profile);
        }
    }

}